import { useState } from "react"

export function Change(){


    function handlejia(){
        setCount(count+1)
    }
    function handlejian(){
        setCount(count-1)
    }

    function handleAge(){
        setObj({
            ...obj,
            age:obj.age+1

        })
    }
    let [count,setCount] = useState(0)

    let [obj,setObj] = useState({
        age:12
    })
    return (
        <div>
            <button onClick={handlejia}>+</button>
            {count}
            <button onClick={handlejian}>-</button>

            <button onClick={handleAge}>{obj.age}</button>
        </div>
    )
}